package cn.kgc.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.ValueOperations;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/redis")
public class TestControlelr {

    @Autowired
    ValueOperations<String, Object> valueOperations;

    @RequestMapping("/name")
    public String hello(){
        valueOperations.set("name","花花");
        System.out.println(valueOperations.get("name"));
        return (String) valueOperations.get("name");
    }

}
